
<?php
	require_once("../../includes/user.php");
	$user=new User();
	$b_res=$user->query("select * from user_profile where block=1");
?>
<table width="619" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="619"><div class="Innerheading" id="Innerheading">Block User</div></td>
  </tr>
  <tr>
    <td><div class="InnerDarkbox" id="InnerDarkbox">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
    	<tr>
          <td colspan="4" align="center" valign="middle" class="head">&nbsp;</td>
          <td align="right" valign="middle" class="head"><span onClick="selectblockuser()"><img src="img/buttons/b_newtbl.png" width="16" height="16"> <span class="smartlink">Block</span></span> </td>
       	</tr>
    <?php if(mysql_num_rows($b_res)>0)
	{ ?>
        <tr>
          <td width="21%" align="center" valign="middle" class="head">Name</td>
          <td width="20%" align="center" valign="middle" class="head">Year</td>
          <td width="21%" align="center" valign="middle" class="head">Regno/Desg</td>
          <td width="22%" align="center" valign="middle" class="head">House</td>
          <td width="16%" align="center" valign="middle" class="head">&nbsp;</td>
        </tr>
       <?php
	   while($b_row=mysql_fetch_array($b_res))
	   {
	    ?>
        <tr>
          <td colspan="5">&nbsp;</td>
          </tr>
        <tr>
          <td align="center" valign="middle"><?php echo $b_row['name']; ?></td>
          <td align="center" valign="middle"><?php echo $user->getYear($b_row['year']); ?></td>
          <td align="center" valign="middle"><?php 
		  if($b_row['role']==1)
		  {
		  	echo $b_row['regno']; 
			}
			else
			{
				echo $b_row['desg'];
			}
		  ?></td>
          <td align="center" valign="middle"><?php echo $user->getHouse($b_row['house']); ?></td>
          <td align="center" valign="middle"><span class="smartlink" onclick="unblock(<?php echo $b_row['id'];  ?>)">Unblock</span></td>
        </tr>
        <?php
		} 
		}
		else{ ?>
        <tr>
          <td colspan="5" align="center" valign="middle">There is no blocked users</td>
          </tr>
      <?php } ?>
      </table>
    </div></td>
  </tr>
</table>